using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._ContingentValues
{
    /// <summary>
    /// <para>Import Contingent Values</para>
    /// <para>Imports multiple contingent values and field groups from a comma-separated values file (.csv) into a dataset.</para>
    /// <para>将多个条件值和字段组从逗号分隔值文件 （.csv） 导入到数据集中。</para>
    /// </summary>    
    [DisplayName("Import Contingent Values")]
    public class ImportContingentValues : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ImportContingentValues()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_target_table">
        /// <para>Target Table</para>
        /// <para>The input geodatabase table or feature class to which the field groups and contingent values will be imported.</para>
        /// <para>字段组和条件值将导入到其中的输入地理数据库表或要素类。</para>
        /// </param>
        /// <param name="_field_group_file">
        /// <para>Field Groups Input File (.csv)</para>
        /// <para>A .csv file with specific column names that contains information about the field groups.</para>
        /// <para>具有特定列名称的.csv文件，其中包含有关字段组的信息。</para>
        /// </param>
        /// <param name="_contingent_value_file">
        /// <para>Contingent Values Input File (.csv)</para>
        /// <para>A .csv file with specific column names that contains information about the contingent values.</para>
        /// <para>具有特定列名称的.csv文件，其中包含有关条件值的信息。</para>
        /// </param>
        public ImportContingentValues(object _target_table, object _field_group_file, object _contingent_value_file)
        {
            this._target_table = _target_table;
            this._field_group_file = _field_group_file;
            this._contingent_value_file = _contingent_value_file;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Import Contingent Values";

        public override string CallName => "management.ImportContingentValues";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_target_table, _field_group_file, _contingent_value_file, _import_type.GetGPValue(), _updated_table];

        /// <summary>
        /// <para>Target Table</para>
        /// <para>The input geodatabase table or feature class to which the field groups and contingent values will be imported.</para>
        /// <para>字段组和条件值将导入到其中的输入地理数据库表或要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _target_table { get; set; }


        /// <summary>
        /// <para>Field Groups Input File (.csv)</para>
        /// <para>A .csv file with specific column names that contains information about the field groups.</para>
        /// <para>具有特定列名称的.csv文件，其中包含有关字段组的信息。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Groups Input File (.csv)")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _field_group_file { get; set; }


        /// <summary>
        /// <para>Contingent Values Input File (.csv)</para>
        /// <para>A .csv file with specific column names that contains information about the contingent values.</para>
        /// <para>具有特定列名称的.csv文件，其中包含有关条件值的信息。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Contingent Values Input File (.csv)")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _contingent_value_file { get; set; }


        /// <summary>
        /// <para>Replace existing contingent values</para>
        /// <para><xdoc>
        ///   <para>Specifies whether existing values will be replaced or merged upon import.
        ///   <bulletList>
        ///     <bullet_item>Checked—Existing values for the target table will be replaced with the values in the input .csv files.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Existing values will be merged with the values in the input .csv files. Any duplicates will be excluded. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定在导入时是否要替换或合并现有值。
        ///   <bulletList>
        ///     <bullet_item>选中 - 目标表的现有值将替换为输入.csv文件中的值。</bullet_item><para/>
        ///     <bullet_item>未选中 - 现有值将与输入.csv文件中的值合并。任何重复项都将被排除在外。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Replace existing contingent values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _import_type_value _import_type { get; set; } = _import_type_value._false;

        public enum _import_type_value
        {
            /// <summary>
            /// <para>REPLACE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("REPLACE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>UNION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("UNION")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _updated_table { get; set; }


        public ImportContingentValues SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}